package com.ywgt.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ywgt.pojo.Role;
import com.ywgt.mapper.RoleMapper;
import com.ywgt.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色表 服务实现类
 * </p>
 *
 * @author yiping
 * @since 2021-03-12
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Override
    public List<Role> getAll() {
        return baseMapper.selectAll();
    }

    @Override
    public Page<Role> getRoles(String name, int page, int limit, String sort, String order) {
        PageHelper.startPage(page,limit);
        return baseMapper.selectRoles(name,sort,order);
    }
}
